package com.xuecheng.manage_course.clients;

import com.xuecheng.framework.domain.cms.CmsPage;
import com.xuecheng.framework.domain.cms.response.CmsPageResult;
import com.xuecheng.framework.domain.cms.response.CmsPostPageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(value = "XC-SERVICE-MANAGE-CMS")
public interface CmsPageClient {
    String pre = "/cms/page";

    /**
     * 根据页面id查询页面信息
     * @param id
     * @return
     */
    @GetMapping(pre + "/get/{id}")
    public CmsPageResult findCmsPageById(@PathVariable("id") String id);

    /**
     * 添加页面，用于课程预览
     * @param cmsPaged
     * @return
     */
    @PostMapping(pre + "/save")
    public CmsPageResult saveCmsPage(@RequestBody CmsPage cmsPaged);

    /**
     * 一键发布页面
     * @param cmsPage
     * @return
     */
    @PostMapping(pre + "/postPageQuick")
    public CmsPostPageResult postPageQuick(@RequestBody CmsPage cmsPage);
}
